import {h,init} from 'snabbdom'
//1,导入模块
import style from "snabbdom/modules/style"
import eventlisteners from "snabbdom/modules/eventlisteners"
import eventlistenersModule from "snabbdom/modules/"
//2,注册模块
let data = [{id:1,name:"The Shawshank Redemption"},
            {id:2,name:"The Shawshank Redemption"},
            {id:3,name:"The Shawshank Redemption"}]

let lastId  = data[ data.length - 1 ] ? data[ data.length - 1 ].id + 1 : 1
let oldVnode = null
function render(result){

}

function view(heroes){
  return h('div.main',[
    h('div.btn-box',[h('div.btn.add'),{on:{click:add}},"增加"]),
    h('div.btn.sort',"排序")
    ]),
    h('div.content',[aa(heroes)])
}
function aa(heroes){

}

// let patch = init([style,eventlisteners])
// // 3,使用模块 h()函数第二个参数传入模块需要的书
// let vnode = h('div.container.box',{style:{backgroundColor:'plum'},on:{
//   click:eventHandler
// }},[h("h1","标题"),h('p',"段落")])

// let app = document.querySelector("#app")
// let oldVnode = patch(app,vnode)
// function eventHandler(){
//   console.log('点击我了')
// }
// setTimeout(()=>{
//   vnode = h('div.container.box',"我的全部")
//   // patch(oldVnode,vnode)

//   // patch(oldVnode,h('!'))
// },2000)



